<!-- 分页 -->
<template>
  <div class="pagecontain">
    <el-pagination layout="prev, pager, next" :total="total" @current-change="handlepage"> </el-pagination>
  </div>
</template>

<script>
import { mapState, mapMutations } from 'vuex'
import { getUser } from '@/api/index.js'
export default {
  computed: {
    ...mapState({
      total: state => state.tab.total,
      pagelimit: state => state.tab.pagelimit
    })
  },

  data() {
    return {}
  },
  methods: {
    ...mapMutations(['gettableData']),
    getuserlist() {
      getUser({ params: this.pagelimit }).then(({ data }) => {
        // this.tableData = data.list
        this.gettableData(data)
      })
    },

    handlepage(val) {
      // console.log(val)
      this.pagelimit.page = val
      this.getuserlist()
    }
  }
}
</script>

<style lang="less" scoped>
.pagecontain {
  display: flex;
  justify-content: flex-end;
}
</style>
